package views;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.zx.theline.R;

import java.util.List;

import GsonBean.AddPointBean;

/**
 * Created by rkq on 2017/3/28.
 * 安全风险内容 组件 不可编辑只能显示信息
 */


public class AddDangerPointTextView extends LinearLayout {
    TextView aqfxnr;
    TextView aqfxcs;
    public TextView scfxd;
    int position=0;
    private List<AddPointBean.ExistingFxdListBean> existingFxdList;

    public AddDangerPointTextView(Context context, List<AddPointBean.ExistingFxdListBean> existingFxdList) {
        super(context);
        this.existingFxdList=existingFxdList;
        setView();

    }

    public AddDangerPointTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
        setView();
    }

    public AddDangerPointTextView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setView();
    }

    public void setView() {
        View view = inflate(getContext(), R.layout.bcfxd, null);
        this.addView(view);
        aqfxnr = (TextView) view.findViewById(R.id.aqfxnr);
        aqfxcs = (TextView) view.findViewById(R.id.aqfxcs);
        scfxd= (TextView) view.findViewById(R.id.scfxd);
//        scfxd.setVisibility(GONE);
        aqfxnr.setText(existingFxdList.get(0).getAqfxnr());
        aqfxcs.setText(existingFxdList.get(0).getAqfxcsnr());
    }

    public void readOnly(){
        aqfxnr.setBackgroundColor(Color.WHITE);
        aqfxcs.setBackgroundColor(Color.WHITE);
    }

}
